home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / MAP Viewer / AboutForm.cpp next >
C/C++ Source or Header  |  2003-10-09  |  5KB  |  135 lines

  1. /*
  2. Half-Life MAP viewing utility.
  3. Copyright (C) 2003  Ryan Samuel Gregg
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18. */
  19.  
  20. #include "stdafx.h"
  21. #include "AboutForm.h"
  22.  
  23. CAboutForm::CAboutForm(String *Version, String *Author, String *Date, String *Language, String *Lines)
  24. {
  25.     this->grpAbout = new System::Windows::Forms::GroupBox();
  26.  
  27.     this->lblVersion = new System::Windows::Forms::Label();
  28.     this->lblAuthor = new System::Windows::Forms::Label();
  29.     this->lblDate = new System::Windows::Forms::Label();
  30.     this->lblLanguage = new System::Windows::Forms::Label();
  31.     this->lblLines = new System::Windows::Forms::Label();
  32.  
  33.     this->lnkNemsTools = new System::Windows::Forms::LinkLabel();
  34.  
  35.     this->cmdOK = new System::Windows::Forms::Button();
  36.  
  37.     // Form Setup
  38.     this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
  39.     this->Text = "About MAP Viewer";
  40.     this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
  41.     this->Size = System::Drawing::Size(300, 232);
  42.     this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
  43.     this->MaximizeBox = false;
  44.     this->MinimizeBox = false;
  45.     this->ShowInTaskbar = false;
  46.  
  47.     this->Controls->Add(this->grpAbout);
  48.     this->Controls->Add(this->cmdOK);
  49.  
  50.     // Setup Group
  51.     this->grpAbout->FlatStyle = System::Windows::Forms::FlatStyle::System;
  52.     this->grpAbout->Location = System::Drawing::Point(8, 8);
  53.     this->grpAbout->Size = System::Drawing::Size(280, 152);
  54.     this->grpAbout->TabIndex = 1;
  55.     this->grpAbout->TabStop = false;
  56.  
  57.     this->grpAbout->Controls->Add(this->lblVersion);
  58.     this->grpAbout->Controls->Add(this->lblAuthor);
  59.     this->grpAbout->Controls->Add(this->lblDate);
  60.     this->grpAbout->Controls->Add(this->lblLanguage);
  61.     this->grpAbout->Controls->Add(this->lblLines);
  62.     this->grpAbout->Controls->Add(this->lnkNemsTools);
  63.  
  64.     // Version
  65.     this->lblVersion->FlatStyle = System::Windows::Forms::FlatStyle::System;
  66.     this->lblVersion->Location = System::Drawing::Point(90, 36);
  67.     this->lblVersion->Size = System::Drawing::Size(100, 16);
  68.     this->lblVersion->TabIndex = 1;
  69.     this->lblVersion->Text = String::Concat(S"Version: ", Version);
  70.  
  71.     // Author
  72.     this->lblAuthor->FlatStyle = System::Windows::Forms::FlatStyle::System;
  73.     this->lblAuthor->Location = System::Drawing::Point(90, 52);
  74.     this->lblAuthor->Size = System::Drawing::Size(100, 16);
  75.     this->lblAuthor->TabIndex = 2;
  76.     this->lblAuthor->Text = String::Concat(S"Author: ", Author);
  77.  
  78.     // Date
  79.     this->lblDate->FlatStyle = System::Windows::Forms::FlatStyle::System;
  80.     this->lblDate->Location = System::Drawing::Point(90, 68);
  81.     this->lblDate->Size = System::Drawing::Size(100, 16);
  82.     this->lblDate->TabIndex = 3;
  83.     this->lblDate->Text = String::Concat(S"Date: ", Date);
  84.  
  85.     // Language
  86.     this->lblLanguage->FlatStyle = System::Windows::Forms::FlatStyle::System;
  87.     this->lblLanguage->Location = System::Drawing::Point(90, 84);
  88.     this->lblLanguage->Size = System::Drawing::Size(100, 16);
  89.     this->lblLanguage->TabIndex = 4;
  90.     this->lblLanguage->Text = String::Concat(S"Written In: ", Language);
  91.  
  92.     // Lines
  93.     this->lblLines->FlatStyle = System::Windows::Forms::FlatStyle::System;
  94.     this->lblLines->Location = System::Drawing::Point(90, 100);
  95.     this->lblLines->Size = System::Drawing::Size(100, 16);
  96.     this->lblLines->TabIndex = 5;
  97.     this->lblLines->Text = String::Concat(S"Lines: ", Lines);
  98.  
  99.     // Link
  100.     this->lnkNemsTools->Location = System::Drawing::Point(200, 128);
  101.     this->lnkNemsTools->Size = System::Drawing::Size(72, 16);
  102.     this->lnkNemsTools->TabIndex = 6;
  103.     this->lnkNemsTools->TabStop = true;
  104.     this->lnkNemsTools->LinkColor = System::Drawing::Color::Black;
  105.     this->lnkNemsTools->VisitedLinkColor = System::Drawing::Color::Black;
  106.     this->lnkNemsTools->Text = "Nem\'s Tools";
  107.  
  108.     // OK
  109.     this->cmdOK->FlatStyle = System::Windows::Forms::FlatStyle::System;
  110.     this->cmdOK->Location = System::Drawing::Point(112, 168);
  111.     this->cmdOK->TabIndex = 0;
  112.     this->cmdOK->Text = "OK";
  113.  
  114.     this->add_Closing(new ::CancelEventHandler(this, &CAboutForm::CAboutForm_Closeing));
  115.  
  116.     this->lnkNemsTools->add_LinkClicked(new ::LinkLabelLinkClickedEventHandler(this, &CAboutForm::lnkNemsTools_LinkClicked));
  117.  
  118.     this->cmdOK->add_Click(new ::EventHandler(this, &CAboutForm::cmdOK_Click));
  119. }
  120.  
  121. void CAboutForm::CAboutForm_Closeing(::Object *sender, ::CancelEventArgs *e)
  122. {
  123.     e->Cancel = true;
  124.     this->Hide();
  125. }
  126.  
  127. void CAboutForm::lnkNemsTools_LinkClicked(::Object *sender, ::LinkLabelLinkClickedEventArgs *e)
  128. {
  129.     System::Diagnostics::Process::Start("IExplore.exe", "http://countermap.counter-strike.net/Nemesis/");
  130. }
  131.  
  132. void CAboutForm::cmdOK_Click(::Object *sender, ::EventArgs *e)
  133. {
  134.     this->Hide();
  135. }